/**
 * Copyright (c) 2006 RiseSoft Co.,Ltd  
 * $Header$
 */
package cn.newtest.bi.collection.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import net.risesoft.risebi.collection.model.ReportInstance;
import net.risesoft.risebi.collection.model.User;

import org.appfuse.service.Manager;

/**
 * @author <a href="mailto: chenjian@risesoft.net">陈健</a>
 * @author <a href="mailto: baiyibing@gmail.com">王锤</a>
 * @author <a href="mailto: dingzhaojun2046@gmail.com">丁兆俊</a>
 * @version $Revision$
 * 
 */
public interface ReportInstanceManager extends Manager {
	
	public Map getPagedReportInstancesByObject(ReportInstance reportInstance,int start,int limit) throws Exception;	
	
	public String getNativeQurySql4SystemUser(
			String databaseName,
			User user,
			Boolean inWindow,
			String reportVerifyType,
			Integer lockStatus,
			Integer reportStatus,
			String filter,
			String selectedServiceGuid,
			String selectedAppGuid,
			String selectedSoCollectionGuid,
			String selectedStartSotNodeGuid,
			String selectedStartSotNodeInstanceGuid,
			String selectedEndSotNodeGuid) throws Exception;
	
	public String getNativeQurySql4EnterpriseUser(
			String databaseName,
			User user,
			Boolean inWindow,
			String reportVerifyType,
			Integer lockStatus,
			Integer reportStatus,
			String filter) throws Exception;
	
	/**
	 * 
	 * @param type: 1:urgency 2:late 3:urgency+late
	 * @param reportPeriodTypes
	 * @param serviceGuid
	 * @param currentDateString
	 * @param start
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	List<ReportInstance> getUrgencyOrLateReportInstance(int type,List<String> reportPeriodTypes,String serviceGuid,Date currentDate,int start,int limit) throws Exception;
	
	void lockServiceReportInstance(String serviceGuid,Date currentDate) throws Exception;
	
}
